<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
    <%@ include file="/WEB-INF/component/commonTagLib.jsp"%>
<!DOCTYPE html>
<html>
<head>
	<title>配送关系日志查看</title>
	<%@ include file="/WEB-INF/component/commonCSS.jsp"%>
    <!--[if lt IE 9]>
        <script src="lib/js/html5shiv.min.js"></script>
        <script src="lib/js/respond.min.js"></script>
    <![endif]-->
 	
   
</head>
<body class="skin-blue-light sidebar-mini fixed skin-blue-light-frame">
    <section class="content-header">
        <h1>配送企业选择</h1>
        <ol class="breadcrumb">
           <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i>首页</a></li>
            <li class="active"><a href="#">交易</a></li>
            <li class="active"><a href="#">配送关系</a></li>
            <li class="active"><a href="#">配送关系设置</a></li>
        </ol>
    </section>
    
    <section class="content">
        <div class=" box box-success">
            <div class="box-body">
              <div class="input" style="margin-top:-5px;">    
                    <div class="textalign1">企业名称：</div>
                    <div class="boxinput">
                        <input class="textinput" type="text" name="compName" id="compName" placeholder="企业名称/<spring:message code="message.listForm.pinYinMa"/>" />
                    </div>
                    
                    <!-- <div class="textalign1">企业编码：</div>
                    <div class="boxinput">
                        <input class="textinput" type="text" name="compCode" id="compCode" placeholder="企业编码" />
                    </div> -->
                    
                    <div class="textalign1">操作日期：</div>
                    <div class="boxinput">
                        <table style="width:100%;">
                          <tr>
                           <td style="width:50%">
                              <input class="textinput" type="text" id="startDate"  placeholder="yyyy-MM-dd" maxlength="10" 
                               onFocus="var endDate=$dp.$('endDate');WdatePicker({maxDate:'#F{$dp.$D(\'endDate\')}'})"   />
                           </td>
                           <td>&nbsp;-&nbsp;</td>
                           <td style="width:50%">
                              <input class="textinput" type="text" id="endDate"  placeholder="yyyy-MM-dd" maxlength="10" 
                               onFocus="WdatePicker({minDate:'#F{$dp.$D(\'startDate\')}'})"    />
                           </td>
                          </tr>
                        </table>
                    </div>
                    <div class="textalign1" >
                		<button    id="selectSee" type="button" onclick="gridSerch();" class="btn btn-success btn-sm">查&nbsp;询</button>
                 	</div>
              </div>
            </div>
        </div>
         
        <table class="jqgrid" id="gridlist"></table>
        <div id="prowed2"></div>
        
		<div class=" box box-warning bottongroup" id="bottongroup">
		<label  onclick="window.location.href='${ctx}/baseGoods/toBaseGoodsDelByArea.html?goodsCode=${param.goodsCode}&projID=${param.projID}&goodsArea=${param.goodsArea}'"   class="btn btn-danger btn-sm" >返 回</label>
		</div>
          
</section>
<%@ include file="/WEB-INF/component/commonJS.jsp"%>
<script type="text/javascript">

//绑定回车   id="selectSee"
$('#compName,#compCode,#startDate,#endDate').bind('keydown', function(event) {
    if (event.keyCode == "13") {
        $('#selectSee').click();
    }
}); 
$("#compName").focus();//加载页面光标在第一个查询框内

$(function () {
	$('.form-inline :input').bind('keydown', function(event) {if (event.keyCode == "13") {search();}}).eq(1).focus();

jQuery("#gridlist").jqGrid({
	url: "${ctx}/baseGoods/getBaseDelerationLogList.html?areaCode=${param.areaId}&goodsCode=${param.goodsCode}",
    mtype: "POST",
	datatype: "json",
	autowidth: true,
//	height: 285,
   	colNames:['企业编码','企业名称','组织机构代码','联系人','联系电话','状态','操作时间'],
   	colModel:[
		{name:'compCode',index:'goodsCode', width:100,align:"center", sortable:false,hidden:true},
		{name:'compName',index:'goodsCode', width:190, align:"left",sortable:false},
   		{name:'orgCode',index:'drugName', width:120,align:"center", sortable:false},
   		{name:'contactName',index:'compName', width:100, sortable:false},
   		{name:'contactPhone',index:'areaName', width:80, sortable:false},
   		{name:'status',index:'formName', width:60, align:"center", sortable:false},
   		{name:'updTime',index:'specName', width:120, align:"left", sortable:false}
		
   	],
	 rowNum: 20,
     rowList: [10, 20, 50,100],
     rownumbers: true,
     pager: "#prowed2",
     viewrecords: true,
     gridComplete: function(){
       	//序号列宽度自适应（参数为jqgridID）
          autoRNWidth("gridlist");
       	//数据只有一条时默认选中（参数为jqgridID）
           selectByOneData("gridlist");
		     },
     caption: "${param.goodsCode}/${form.drugCode}/${form.qualityspecName}/${form.formName}/${form.specName}/${form.factor}${form.unit}/${form.materialName}—${areaName}",
     editurl:"proPlanItemListHis.jsp",
     jsonReader: {
         repeatitems: false,
         id: "ids"
     }
   	
});
	 
	jQuery("#gridlist").jqGrid('navGrid',"prowed2",{edit:false,add:false,del:false});
	$("#gridlist").jqGrid("setGridHeight", create());
	$(window).trigger("resize");
});

function gridSerch() {
	var compCode = $.trim($("#compCode").val());
	var compName = $.trim($("#compName").val());
	var startDate = $.trim($("#startDate").val());
	var endDate = $.trim($("#endDate").val());
	$("#gridlist").jqGrid('setGridParam',{  
        datatype:'json',
        postData:{
        	"compCode":compCode,
        	"compName":compName,
        	"startDate":startDate,
        		"endDate":endDate}
    }).trigger("reloadGrid"); //重新载入  
}

</script>
</body>
</html>